package com.eva.client.api.cms;

import com.eva.cms.biz.resource.CmsResourceBiz;
import com.eva.cms.biz.resource.vo.CmsResourceVO;
import com.eva.framework.common.api.BaseController;
import com.eva.framework.common.model.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "资源相关接口")
@RestController
@RequestMapping("/resource")
public class CmsResourceController extends BaseController {

    @Resource
    private CmsResourceBiz cmsResourceBiz;

    @ApiOperation("根据资源组唯一标识查询资源")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "groupUid", value = "栏目唯一标识", dataType = "String", required = true)
    })
    @GetMapping("/{groupUid}/list")
    public ApiResponse<List<CmsResourceVO>> findListByGroupUid(@PathVariable String groupUid) {
        return ApiResponse.success(cmsResourceBiz.findListByGroupUid(groupUid));
    }
}
